echo 'A. Install Zabbix repository'

wget https://repo.zabbix.com/zabbix/5.2/debian/pool/main/z/zabbix-release/zabbix-release_5.2-1+debian10_all.deb 

sudo dpkg -i zabbix-release_5.2-1+debian10_all.deb
sudo rm -rf zabbix-release_5.2-1+debian10_all.deb
sudo apt update

echo "B. Install Zabbix server, frontend, agent"

sudo apt install zabbix-server-pgsql zabbix-frontend-php php7.3-pgsql zabbix-nginx-conf zabbix-agent

echo "C. Create initial database"

sudo -u postgres createuser --pwprompt zabbix
sudo -u postgres createdb -O zabbix zabbix

echo "On Zabbix server host import initial schema and data. You will be prompted to enter your newly created password."
zcat /usr/share/doc/zabbix-server-pgsql*/create.sql.gz | sudo -u zabbix psql zabbix